/*
 * p4045.cpp
 *
 *  Created on: 2013-5-21
 *      Author: zy
 */

#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cstring>
#include<vector>
using namespace std;
const int maxn = 50005;
long long f[maxn], g[maxn], dp[maxn];
int ans[maxn];
vector<int> son[maxn];
int n, I, R;
void dfs1(int s, int pa)//求g【i】:以i为根的子树节点个数，f【i】：到根的距离之和
{

	f[s] = 0;
	g[s] = 1;
	for (int i = 0; i < son[s].size(); i++)
	{
		int v = son[s][i];
		if (v == pa)
			continue;
		dfs1(v, s);
		g[s]+=g[v];
		f[s]+=f[v]+g[v];
	}
}
void dfs2(int s,int pa)//求dp[i]:所有点到i的距离和
{
	if(s==1)dp[s]=f[s];
	else dp[s]=dp[pa]+g[1]-2*g[s];
	for(int i=0;i<son[s].size();i++)
	{
		int v=son[s][i];
		if(v==pa)continue;
		dfs2(v,s);
	}
}
int main()
{
	int T;
	scanf("%d", &T);
	while (T--)
	{
		scanf("%d%d%d", &n, &I, &R);
		for (int i = 0; i <= n; i++)
			son[i].clear();
		memset(f, 0, sizeof(f));
		memset(g, 0, sizeof(g));
		memset(dp, 0, sizeof(dp));
		for (int i = 1; i < n; i++)
		{
			int a, b;
			scanf("%d%d", &a, &b);
			son[a].push_back(b);
			son[b].push_back(a);
		}
		son[1].push_back(0);
		dfs1(1, 0);
		dfs2(1,0);
		long long MIN=0x7ffffffffff;
		int cnt=0;
		for(int i=1;i<=n;i++)
			MIN=min(MIN,dp[i]);
		cout<<I*I*R*MIN<<endl;
		for(int i=1;i<=n;i++)
		{
			if(dp[i]==MIN)
			{
				cnt++;
				ans[cnt]=i;
			}
		}
		for(int i=1;i<cnt;i++)
			printf("%d ",ans[i]);
		printf("%d\n\n",ans[cnt]);
	}
	return 0;
}
